package com.ruoyi.system.service.impl;

import java.util.List;
import java.util.UUID;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysAOwnersListMapper;
import com.ruoyi.system.domain.SysAOwnersList;
import com.ruoyi.system.service.ISysAOwnersListService;
import com.ruoyi.common.core.text.Convert;

/**
 * 业委会管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-11-09
 */
@Service
public class SysAOwnersListServiceImpl implements ISysAOwnersListService 
{
    @Autowired
    private SysAOwnersListMapper sysAOwnersListMapper;

    /**
     * 查询业委会管理
     * 
     * @param ownersId 业委会管理主键
     * @return 业委会管理
     */
    @Override
    public SysAOwnersList selectSysAOwnersListByOwnersId(Long ownersId)
    {
        return sysAOwnersListMapper.selectSysAOwnersListByOwnersId(ownersId);
    }

    /**
     * 查询业委会管理列表
     * 
     * @param sysAOwnersList 业委会管理
     * @return 业委会管理
     */
    @Override
    public List<SysAOwnersList> selectSysAOwnersListList(SysAOwnersList sysAOwnersList)
    {
        return sysAOwnersListMapper.selectSysAOwnersListList(sysAOwnersList);
    }

    /**
     * 新增业委会管理
     * 
     * @param sysAOwnersList 业委会管理
     * @return 结果
     */
    @Override
    public int insertSysAOwnersList(SysAOwnersList sysAOwnersList)
    {
//        if (sysAOwnersList.getOwnersId()==null || "".equals(sysAOwnersList.getOwnersId())) {
//            String s = UUID.randomUUID().toString();
//            String id = "PID"+ DateUtils.dateTime()+s.substring(s.length()-5,s.length()-1);
//            sysAOwnersList.setOwnersId(id);
//        }

        return sysAOwnersListMapper.insertSysAOwnersList(sysAOwnersList);
    }

    /**
     * 修改业委会管理
     * 
     * @param sysAOwnersList 业委会管理
     * @return 结果
     */
    @Override
    public int updateSysAOwnersList(SysAOwnersList sysAOwnersList)
    {
        return sysAOwnersListMapper.updateSysAOwnersList(sysAOwnersList);
    }

    /**
     * 批量删除业委会管理
     * 
     * @param ownersIds 需要删除的业委会管理主键
     * @return 结果
     */
    @Override
    public int deleteSysAOwnersListByOwnersIds(String ownersIds)
    {
        return sysAOwnersListMapper.deleteSysAOwnersListByOwnersIds(Convert.toStrArray(ownersIds));
    }

    /**
     * 删除业委会管理信息
     * 
     * @param ownersId 业委会管理主键
     * @return 结果
     */
    @Override
    public int deleteSysAOwnersListByOwnersId(Long ownersId)
    {
        return sysAOwnersListMapper.deleteSysAOwnersListByOwnersId(ownersId);
    }
}
